﻿@{
    Layout = null;
}
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->
<html lang="en" class="no-js">
<!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>登录后台</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link href="~/bootstrap/plugins/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/plugins/uniform/css/uniform.default.css" rel="stylesheet" type="text/css" />
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link rel="stylesheet" type="text/css" href="~/bootstrap/plugins/select2/select2.css" />
    <link rel="stylesheet" type="text/css" href="~/bootstrap/plugins/select2/select2-metronic.css" />
    <!-- END PAGE LEVEL SCRIPTS -->
    <!-- BEGIN THEME STYLES -->
    <link href="~/bootstrap/css/style-metronic.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/css/style.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/css/style-responsive.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/css/plugins.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/css/themes/default.css" rel="stylesheet" type="text/css" id="style_color" />
    <link href="~/bootstrap/css/pages/login-soft.css" rel="stylesheet" type="text/css" />
    <link href="~/bootstrap/css/custom.css" rel="stylesheet" type="text/css" />
    <!-- END THEME STYLES -->

</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="login">
    <!-- BEGIN LOGO -->
    <div class="logo">

    </div>
    <!-- END LOGO -->
    <!-- BEGIN LOGIN -->
    <div class="content">
        <!-- BEGIN LOGIN FORM -->
        <form class="login-form" action="#" method="post">
            <h3 class="form-title" style="text-align:center;">登录后台 </h3>

            <div class="alert alert-danger hidden" id="divError">

            </div>


            <div class="form-group">
                <!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
                <label class="control-label visible-ie8 visible-ie9">账号</label>
                <div class="input-icon">
                    <i class="fa fa-user"></i>
                    <input class="form-control placeholder-no-fix" type="text" autocomplete="off" placeholder="账号" name="UserNo" id="UserNo" />
                </div>
            </div>
            <div class="form-group">
                <label class="control-label visible-ie8 visible-ie9">密码</label>
                <div class="input-icon">
                    <i class="fa fa-lock"></i>
                    <input class="form-control placeholder-no-fix" type="password" autocomplete="off" placeholder="密码" name="Password" id="Password" />
                </div>
            </div>

            <div class="form-group" style="height:40px;">
                    <div class="col-md-8" style="padding-left:0;padding-right:0;">
                        <div class="input-icon">
                            <i class="fa  fa-h-square"></i>
                            <input type="text" class="form-control" placeholder="验证码" id="ValidateCode">
                        </div>
                    </div>
                    <div class="col-md-3">
                        <img id="valiCode" style="cursor: pointer;margin-top:6px;" src="@Url.Action("CreateValidateCode")" alt="验证码" />
                    </div>
                </div>
            <div class="form-actions">
                <button type="button" class="btn blue pull-right" id="btnLogin">
                    登录 <i class="m-icon-swapright m-icon-white"></i>
                </button>
            </div>
        </form>
        <!-- END LOGIN FORM -->
    </div>
    <!-- END LOGIN -->
    <!-- BEGIN COPYRIGHT -->
    <div class="copyright">
        2017 &copy; wrmk.
    </div>
    <!-- END COPYRIGHT -->
    <!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
    <!-- BEGIN CORE PLUGINS -->
    <!--[if lt IE 9]>
        <script src="~~/bootstrap/plugins/respond.min.js"></script>
        <script src="~~/bootstrap/plugins/excanvas.min.js"></script>
        <![endif]-->
    <script src="~/bootstrap/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/jquery-migrate-1.2.1.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/bootstrap-hover-dropdown/bootstrap-hover-dropdown.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/jquery-slimscroll/jquery.slimscroll.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/jquery.blockui.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/jquery.cookie.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/uniform/jquery.uniform.min.js" type="text/javascript"></script>
    <!-- END CORE PLUGINS -->
    <!-- BEGIN PAGE LEVEL PLUGINS -->
    <script src="~/bootstrap/plugins/jquery-validation/dist/jquery.validate.min.js" type="text/javascript"></script>
    <script src="~/bootstrap/plugins/backstretch/jquery.backstretch.min.js" type="text/javascript"></script>
    <script type="text/javascript" src="~/bootstrap/plugins/select2/select2.min.js"></script>
    <!-- END PAGE LEVEL PLUGINS -->
    <!-- BEGIN PAGE LEVEL SCRIPTS -->
    <script src="~/bootstrap/scripts/core/app.js" type="text/javascript"></script>
    <script src="~/bootstrap/scripts/custom/login-soft.js" type="text/javascript" charset="gbk"></script>
    <!-- END PAGE LEVEL SCRIPTS -->
    <script>
        if (top.location != self.location)
            top.location = self.location;

        jQuery(document).ready(function () {
            App.init();
            Login.init();

            $("#btnLogin").click(function () {
                var remember = $("#remember").is(":checked");
                if ($('.login-form').validate().form()) {
                    $.ajax({
                        url: "@Url.Action("Index")",
                        data: { UserNo: $("#UserNo").val(), Password: $("#Password").val(), ValidateCode: $("#ValidateCode").val()},//, Remember: 0
                        type: "POST",
                        success: function (result) {
                            if (result.resultCode==1000) {
                                location.href = "@Url.Action("Index","Home")";
                            } else {
                                $("#valiCode").click();
                                $("#divError").html("<span>" + result.message + "</span>").removeClass("hidden");
                            }
                        },
                        error: function () {
                            $("#divError").html("<span>登录失败</span>").removeClass("hidden");
                        }
                    });
                }
            });
            $('.login-form input').keypress(function (e) {
                if (e.which == 13) {
                    $("#btnLogin").click();
                }
            });

            $("#valiCode").bind("click", function () {
                this.src = "@Url.Action("CreateValidateCode")?t=" + (new Date()).getTime();
            });

        });
    </script>
    <!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>